package cn.lyd.service.impl;

import cn.lyd.domain.Admin;
import cn.lyd.dto.AdminDto;
import cn.lyd.mapper.AdminMapper;
import cn.lyd.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class AdminServiceImpl implements IAdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Admin loadOne(Admin admin) {
        return adminMapper.loadOne(admin);
    }

    @Override
    public Admin findAccount(String username) {
        return adminMapper.findAccount(username);
    }

    @Override
    @Transactional
    public void addOne(Admin admin) {
        adminMapper.addOne(admin);
        return;
    }

    @Override
    @Transactional
    public void updatePwd(AdminDto adminDto) {
        adminMapper.updatePwd(adminDto);
        return;
    }

}
